import { JUHE_APPKEY } from '@/configs/keys';
import axios from 'axios';
import qs from 'qs';

export function axiosPost (options) {
  return axios({
    url: options.url,
    method: 'POST',
    data: qs.stringify({
      ...options.data,
      key: JUHE_APPKEY
    })
  }).then(res => {
    options.success(res.data);
  })
  .catch(err => {
    options.fail(err);
  })
}